package org.rency.common.memcache.support.annotation;

import org.springframework.stereotype.Component;

@Component
public class AnnotationServiceTestImpl implements AnnotationServiceTest {

	private final String NAMESPACE = "org.rency.common.redis.annotation.test";

	@MCacheData(namespace=NAMESPACE,expireSecond=60)
	@Override
	public String save(@MCacheKeyGenerator String name,String password, boolean isTest) {
		return "Hello "+name+", your password is "+password+", but that is "+isTest;
	}

	@MCacheResult(namespace=NAMESPACE,expireSecond=60)
	@Override
	public String get(@MCacheKeyGenerator String name) {
		return "Hello "+name;
	}

	@MCacheInvalid(namespace=NAMESPACE)
	@Override
	public String remove(@MCacheKeyGenerator String name) {
		return "Hello "+name+ ", but removed!";
	}

	@Override
	public String getCacheNameSpace() {
		return this.NAMESPACE;
	}

}
